<template>
  <div class="login">
    <h1>登录状态： {{ login.isLogin }} </h1>
    <input type="text" v-model="name" />
    <button @click="loginHandler"> login</button>
  </div>
</template>
<script lang="ts" setup>
  import { useLogin } from '@/store/login'
  const name = ref<string>('')
  const login = useLogin()

  // 请求pinia
  const loginHandler = () => login.loginRequest(name.value)
</script>
<style lang="scss" scoped>
  .login {
    background-color: #ccc;
    width: 100%;
    height: 100%;
  }
</style>
